package com.ipzoe.app.controller;

import com.ipzoe.common.core.domain.AjaxResult;
import com.ipzoe.common.core.domain.entity.SysDictData;
import com.ipzoe.system.domain.SysConfig;
import com.ipzoe.system.service.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("系统配置相关")
@RestController
@RequestMapping("api/v1/config")
@Validated
public class ConfigController {

    @Autowired
    private ISysConfigService iSysConfigService;

    @ApiOperation("获取某配置的值")
    @GetMapping("/{configKey}")
    public AjaxResult getConfig(@PathVariable String configKey){

        String configValue = iSysConfigService.selectConfigByKey(configKey);

        return AjaxResult.success(configValue);
    }

}
